Skip to Main Content

Ask The Oracle Mentors

Recently Answered

Recently Answered 2.0

  • #SELECTION#
    Chris Saxon

    Finding purchases on 10+ consecutive days

    I'm trying to use march_recognize() to find purchases made for each customer for 10+ consecutive days. A day being the next calendar date. For example, if customer 1 made 2 purchases on 10-MAY-2024 at 1300 hours and 1400 hours this would not be 2 consecutive days it would be cons...
    #MISC#
    #ACTIONS#
  • #SELECTION#
    Chris Saxon

    Join elimination not occurring when selecting columns only from key-preserved table in view

    CREATE TABLE dept (dept_id NUMBER, dept_name VARCHAR2(50 CHAR), emp_count NUMBER); CREATE TABLE emp (emp_id NUMBER, emp_name VARCHAR2(50 CHAR), dept_id NUMBER); CREATE VIEW vw_dept_empcount AS SELECT d.dept_id, d.dept_name, d.emp_count AS d_emp_count, e.emp_cou
    #MISC#
    #ACTIONS#
  • #SELECTION#
    Chris Saxon

    Converting column number values into array number values in SQL

    I have a table like below. create table t2 ( id varchar2(1),val number) ; insert into t2 values ('a',1); insert into t2 values ('a',2); insert into t2 values ('a',3); insert into t2 values ('a',4); insert into t2 values ('b',1); insert into t2 values ('b',2); insert into t2 value
    #MISC#
    #ACTIONS#
  • #SELECTION#
    Chris Saxon

    PLW-07204: conversion away from column type may result in sub-optimal query plan

    I have been wondering for a long time why a select like "SELECT COUNT(*) INTO l_count FROM foo WHERE c_now >= ts + 1" in the following example issues a PLW-07204 warning but for example "SELECT COUNT(*) INTO l_count FROM foo WHERE ts < c_now - 1" does not. CREATE TABLE foo (ts DA...
    #MISC#
    #ACTIONS#
  • #SELECTION#
    Chris Saxon

    tune these max statements with subquery

    How can I convince my developers there is a better way to do this? SELECT MAX (weight) weight FROM client.pet_weight WHERE pet_id = :pet_id AND setup_date = (SELECT MAX (setup_date) FROM client.pet_w
    #MISC#
    #ACTIONS#

Upcoming Office Hours

Upcoming Office Hours report